package com.lambda;

/**
 * Created by
 *
 * lambda表达式的demo
 * lambda的特点是延迟加载
 * 使用前提是必须存函数式接口
 *
 * @author touni
 * @date 2019/4/28
 * @time 18:42
 */
public class DemoLambda {


    public static String show(int level,FunctionalInterface functionalInterface){
        if (1 == level){ return functionalInterface.abMethod(); }
        return  "sssss";
    }


    public static void main(String[] args) {
        System.out.println(show(1,() -> {return "str字符串！";}));
        System.out.println(show(2,() -> {return "str字符串！";}));



    }









}
